package com.link.base.microinterface.microservice;

import com.link.base.loyalty.transaction.model.Transaction;
import com.link.microservice.config.LinkFeignClientConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
import java.util.Map;

/**
 * @author zhangyuaho
 * @version 1.0
 * @description 忠诚度会员Client
 * @date 2019-8-5 19:18:32
 */
@FeignClient(name = "LINK-LOYALTY", configuration = LinkFeignClientConfig.class)
public interface TransactionClient {

    /**
     * 创建交易
     *
     * @author NingLanhao
     * @date 2019-07-22 19:59
     * @param transaction
     * @return java.util.Map
     */
    @PostMapping(value = "/loyalty/transaction/createAndExecuteTxn", produces = "application/json; charset=UTF-8")
    public Map<String, Object> createAndExecuteTxn(List<Transaction> transaction) throws Exception;

    /**
     * 插入交易
     *
     * @author huanglongjian
     * @date 2019-07-22 19:59
     */
    @PostMapping(value = "/loyalty/transaction/insert", produces = "application/json; charset=UTF-8")
    public Map<String, Object> insert(Transaction transaction) throws Exception;

}
